Optimal. Leaf size=50 \[ \frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{\sqrt{b} f (a-b)}-\frac{x}{a-b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0792586, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {3670, 481, 203, 205} \[ \frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{\sqrt{b} f (a-b)}-\frac{x}{a-b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3670
Rule 481
Rule 203
Rule 205
Rubi steps
\begin{align*} \int \frac{\tan ^2(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}+\frac{a \operatorname{Subst}\left (\int \frac{1}{a+b x^2} \, dx,x,\tan (e+f x)\right )}{(a-b) f}\\ &=-\frac{x}{a-b}+\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{(a-b) \sqrt{b} f}\\ \end{align*}
Mathematica [A] time = 0.0305413, size = 49, normalized size = 0.98 \[ \frac{\tan ^{-1}(\tan (e+f x))-\frac{\sqrt{a} \tan ^{-1}\left (\frac{\sqrt{b} \tan (e+f x)}{\sqrt{a}}\right )}{\sqrt{b}}}{b f-a f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.017, size = 52, normalized size = 1. \begin{align*}{\frac{a}{f \left ( a-b \right ) }\arctan \left ({b\tan \left ( fx+e \right ){\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) }{f \left ( a-b \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.14065, size = 409, normalized size = 8.18 \begin{align*} \left [-\frac{4 \, f x + \sqrt{-\frac{a}{b}} \log \left (\frac{b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} - 4 \,{\left (b^{2} \tan \left (f x + e\right )^{3} - a b \tan \left (f x + e\right )\right )} \sqrt{-\frac{a}{b}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right )}{4 \,{\left (a - b\right )} f}, -\frac{2 \, f x - \sqrt{\frac{a}{b}} \arctan \left (\frac{{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt{\frac{a}{b}}}{2 \, a \tan \left (f x + e\right )}\right )}{2 \,{\left (a - b\right )} f}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.60685, size = 292, normalized size = 5.84 \begin{align*} \begin{cases} \tilde{\infty } x & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac{- x + \frac{\tan{\left (e + f x \right )}}{f}}{a} & \text{for}\: b = 0 \\\frac{x}{b} & \text{for}\: a = 0 \\\frac{f x \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac{f x}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac{\tan{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text{for}\: a = b \\\frac{x \tan ^{2}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\- \frac{2 i \sqrt{a} b f x \sqrt{\frac{1}{b}}}{2 i a^{\frac{3}{2}} b f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{2} f \sqrt{\frac{1}{b}}} + \frac{a \log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 i a^{\frac{3}{2}} b f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{2} f \sqrt{\frac{1}{b}}} - \frac{a \log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 i a^{\frac{3}{2}} b f \sqrt{\frac{1}{b}} - 2 i \sqrt{a} b^{2} f \sqrt{\frac{1}{b}}} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.56394, size = 184, normalized size = 3.68 \begin{align*} \frac{\frac{\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \sqrt{\frac{1}{2}} \tan \left (f x + e\right )}{\sqrt{\frac{a + b + \sqrt{{\left (a + b\right )}^{2} - 4 \, a b}}{b}}}\right )}{{\left | -a + b \right |}} - \frac{\sqrt{a b}{\left (\pi \left \lfloor \frac{f x + e}{\pi } + \frac{1}{2} \right \rfloor + \arctan \left (\frac{2 \, \sqrt{\frac{1}{2}} \tan \left (f x + e\right )}{\sqrt{\frac{a + b - \sqrt{{\left (a + b\right )}^{2} - 4 \, a b}}{b}}}\right )\right )}{\left | b \right |}}{b^{2}{\left | -a + b \right |}}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]